public class Test {
    public static void main(String[] args) {
        //创建一个栈
        MyStack myStack = new MyStack(5);
        myStack.push(2);
        myStack.push(3);
        myStack.push(4);

        while(!myStack.isEmpty()) {
            System.out.print(myStack.pop() + " ");
        }
        System.out.println();


        //创建一个队列
        MyQueue myQueue = new MyQueue(3);
        myQueue.offer(1);
        myQueue.offer(2);
        myQueue.offer(3);

        System.out.println();
        myQueue.poll();
        myQueue.poll();
        myQueue.offer(7);
        myQueue.offer(8);

        while (!myQueue.isEmpty()) {
            System.out.print(myQueue.poll() + " ");
        }
    }
}
